import service from "/@/utils/request"
import request from "/@/utils/request";

/**
 * 新增
 * @param data
 * @returns {*}
 */
export function getMesColorDetailSave (data) {
  return service.post('eletile-mes/mesColorRecord/notoken/save', data)
}

/**
 * 成品料号
 * @param data
 * @returns {*}
 */
export function getFinishedGoodsMaterialCode () {
  return service.post('eletile-mes/mesColorRecord/notoken/getFinishedGoodsMaterialCode')
}

/**
 * 获取表单
 * @param data
 * @returns {*}
 */
// export function getInfo (data) {
//   return service.get('eletile-mes/mesColorRecord/page', data)
// }

export const getInfo = (params) => {
  return service({
    url: 'eletile-mes/mesColorRecord/page',
    method: 'get',
    params,
  });
};

/**
 * 打印所有
 * @param data
 * @returns {*}
 */
export function printAllObj () {
  return service.post('eletile-mes/mesColorDetail/getPageSet')
}

/**
 * 打印正在
 * @param data
 * @returns {*}
 */
export function beingProducedObj () {
  return service.post('eletile-mes/mesColorDetail/getPageSet')
}

/**
 * 删除
 * @param data
 * @returns {*}
 */
export function deleteBatcht (data) {
  return service.post('eletile-mes/mesColorRecord/notoken/deleteBatch', data)
}

/**
 * 重新上传图片
 * @param data
 * @returns {*}
 */
export function updatePictureUrl (data) {
  return service.post('eletile-mes/mesColorRecord/updatePictureUrl', data)
}

/**
 * 正在生产的产线
 * @param data
 * @returns {*}
 */
export function getColorCard () {
  return service.post('eletile-mes/mesColorRecord/getColorCard')
}
/**
 * 打印机
 * @param data
 * @returns {*}
 */
export function getPrint (data) {
  return service.post('eletile-mes/mesColorRecord/getIotBaseinfoDByCode', data)
}

/**
 * 打印
 * @param data
 * @returns {*}
 */
export function setPrint (id, isShowLine, printerName) {
  return service.post('eletile-mes/mesColorRecord/printColorRecord', { id, isShowLine, printerName })
}

/**
 * 获取花色
 * @param data
 * @returns {*}
 */
export function getDicItemByCode () {
  return service.post('eletile-mes/mesColorRecord/notoken/getColorMatch')
}
